<template>
  <div>
    <button class="button" @click="toList">登录</button>
  </div>
</template>

<script>
export default {
    name:'BackButton',
    methods:{
      toList(){

        const account = this.$store.state.login_account
        const password = this.$store.state.login_password
        if(password===''){
          this.$message.error('密码为空');
        }
        else if(account===''){
          this.$message.error('账号不能为空');
        }
        else if(password!=='123456'){
          this.$message.error('密码错误');
        }
        else if(account!=='admin'){
          this.$message.error('用户名错误');
        }
        else{
          this.$message({
            message: '登录成功',
            type: 'success'
          });
          this.$router.push({
            name:'List'
          })
        }

      }
    }
}
</script>

<style scoped>
.button{
    width:240px;
    height: 28px;
    margin-top: 30px;
    margin-left: 49px;
    border-radius: 5px;;
    border:none;
    color: #fff;
    font-weight: 700;
    background-color:#F65858;

}
</style>
